import request from '@/utils/request'

// 查询机构管理列表
export function listOrganization(query, page = true) {
  // 合并分页参数和查询参数
  const params = { ...query, page }
  return request({
    url: '/service/organization/list',
    method: 'get',
    params: params
  })
}

// 查询机构管理详细
export function getOrganization(id) {
  return request({
    url: '/service/organization/' + id,
    method: 'get'
  })
}

// 新增机构管理
export function addOrganization(data) {
  return request({
    url: '/service/organization',
    method: 'post',
    data: data
  })
}

// 修改机构管理
export function updateOrganization(data) {
  return request({
    url: '/service/organization',
    method: 'put',
    data: data
  })
}

// 删除机构管理
export function delOrganization(id) {
  return request({
    url: '/service/organization/' + id,
    method: 'delete'
  })
}
